import { Navigate, createBrowserRouter } from "react-router-dom";
import RequireAuth from "@/components/RequireAuth";
import Login from "@/pages/Login";
import Home from "@/pages/Home";
import Chat from "@/pages/Chat";

export const router = createBrowserRouter([
  {
    path: "/",
    element: <Navigate to="/home" />,
  },
  {
    path: "/login",
    element: <Login />,
  },
  {
    path: "/home",
    element: (
      <RequireAuth>
        <Home />
      </RequireAuth>
    ),
  },
  {
    path: "/chat/:promptId",
    element: (
      <RequireAuth>
        <Chat />
      </RequireAuth>
    ),
  },
]);
